package d0326;

import java.util.HashSet;
import java.util.Set;

public class StudentHashSet {


    public static void main(String[] args) {
        Set<Student> set=new HashSet<>();

        Student st1=new Student("JCAK",21,98);
        Student st2=new Student("LUCY",22,98);
        Student st3=new Student("JCAK",21,98);

        set.add(st1);
        set.add(st2);
        set.add(st3);
        System.out.println("元素个数是："+set.size());

        for (Student stu:
             set) {
            System.out.println(stu);
        }

        /*System.out.println("===================");

        Integer<Student> iterator=set.iterator();
        while (iterator.hasNext()){
            Student student=iterator.next();
            System.out.println(student);
        }*/
    }

}
